//
//  MyCollectionViewCell.m
//  23-HomeWorkQQMusic
//
//  Created by dllo on 16/8/12.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "MyCollectionViewCell.h"
#import "List.h"
#import "MvList.h"
#import "UIImageView+WebCache.h"
@implementation MyCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self creatSubView:self.bounds];
    }
    return self;
}
- (void)creatSubView :(CGRect)sender {
    self.imageTitle = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height * 0.7)];
    [self.contentView addSubview:_imageTitle];
    self.labelTop = [[UILabel alloc] initWithFrame:CGRectMake(0, _imageTitle.frame.size.height, self.frame.size.width, self.bounds.size.height * 0.1)];
    [self.contentView addSubview:_labelTop];
    _labelDown = [[UILabel alloc] initWithFrame:CGRectMake(0, self.frame.size.height * 0.8, self.bounds.size.width, self.bounds.size.height * 0.2)];
    [self.contentView addSubview:_labelDown];
}

- (void)setMvList:(MvList *)mvList {
    _mvList = mvList;
    _labelTop.text = [NSString stringWithFormat:@"%@-%@", mvList.mvtitle, mvList.singername];
    _labelDown.text = mvList.mvdesc;
    if (mvList.picurl.length != 0) {
      [_imageTitle sd_setImageWithURL:[NSURL URLWithString:mvList.picurl] placeholderImage:nil];
    } else {
        NSString *imageUrl = [NSString stringWithFormat:@"http://shp.qpic.cn/qqvideo_ori/0/%@_360_204/0?max_age=259200", mvList.vid];
    [_imageTitle sd_setImageWithURL:[NSURL URLWithString:imageUrl]placeholderImage:nil];
    }
    
}


@end
